From 7b4a7a771e4b2151591a53e66d96e5eecfb01653 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 1 Oct 2002 18:37:27 +0000 Subject: [PATCH] Stupid windows doesn't get feof right, so add test for null read at eof. --- gpx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpx.c b/gpx.c index 152ff2194..ce7ad7442 100644 --- a/gpx.c +++ b/gpx.c @@ -195,7 +195,7 @@ gpx_read(void) while (!done) { len = fread(buf, 1, sizeof(buf), fd); - done = feof(fd); + done = feof(fd) || !len; if (!XML_Parse(psr, buf, len, done)) { fatal(MYNAME ": XML parse error at %d: %s\n", XML_GetCurrentLineNumber(psr), -- 2.30.2